import request from '@/utils/request'

// 创建产品规格
export function addSpecification(data) {
  return request({
    url: '/product/specification/create',
    method: 'post',
    data: data
  })
}

// 更新产品规格
export function updateSpecification(data) {
  return request({
    url: '/product/specification/update',
    method: 'put',
    data: data
  })
}

// 删除产品规格
export function delSpecification(id) {
  return request({
    url: '/product/specification/delete?id=' + id,
    method: 'delete'
  })
}

// 获得产品规格
export function getSpecification(id) {
  return request({
    url: '/product/specification/get?id=' + id,
    method: 'get'
  })
}

// 获得产品规格分页
export function getPage(query) {
  return request({
    url: '/product/specification/page',
    method: 'get',
    params: query
  })
}

// 导出产品规格 Excel
export function exportSpecification(query) {
  return request({
    url: '/product/specification/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
